Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid constructing objects if not needed #248

Merged
merged 1 commit into from
Jun 10, 2014
Merged

Conversation

yanns
Copy link
Member

@yanns yanns commented Jun 2, 2014

No description provided.

yanns referenced this pull request in yanns/play2-war-plugin Jun 2, 2014
The handling of a play result in the default request handler is moved
to pushPlayResultToServletOS. This handling stayed the same. This change
should not have any impact on the existing servlet wrapper for servlet < 3.1.

For servlet 3.1, pushPlayResultToServletOS is overwritten to provide a
non-blocking asynchron handling based on the new WriteListener.
@@ -108,9 +108,9 @@ class Play2Servlet31RequestHandler(servletRequest: HttpServletRequest)

if (servletInputStream.isFinished) {
Logger("play.war.servlet31").trace("will extract result from nextStep")
nextStep.run.map { a =>
nextStep.run.onComplete { a =>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to try to avoid explicit completes and onComplete and instead do it in a flow (avoid callbacks).

result.completeWith(nextStep.run.andThen(_ => Logger("play.war.servlet31").trace("extract result from nextStep")))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point!

yanns added a commit that referenced this pull request Jun 10, 2014
avoid constructing objects if not needed
@yanns yanns merged commit a6b9160 into play2war:develop Jun 10, 2014
@yanns yanns deleted the mini-fixes branch June 10, 2014 13:41
@dlecan dlecan added this to the v1.2 milestone Jun 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants